/*
 * Copyright 2011 OpenWAF.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.openwaf.client.core;

import com.openwaf.common.annotation.NoJavaScript;


public class JSString implements Comparable<JSString>{
    //standard string methods provided natively
    //http://www.w3schools.com/jsref/jsref_obj_string.asp

    protected JSString(){}
    @NoJavaScript
    public native char charAt(int index);

    @NoJavaScript
    public native int charCodeAt(int index);

    @NoJavaScript
    public native JSString concate(JSString... str);

    @NoJavaScript
    public native JSString fromCharCode(char ch);
    
    @NoJavaScript 
    public native int indexOf(JSString str);
    
    @NoJavaScript
    public native int indexOf(JSString str,int start);
    

    @NoJavaScript
    public native int lastIndexOf(JSString str);

    @NoJavaScript
    public native int lastIndexOf(JSString str,int start);


    //TODO:match not implemented yet
    @NoJavaScript
    public native JSString replace(JSString substr,JSString newstr);


    @NoJavaScript
    public native int search(JSString str);

    @NoJavaScript
    public native JSString slice(int start);

    @NoJavaScript
    public native JSString slice(int start,int end);

    @NoJavaScript
    public native JSString[] split();

    @NoJavaScript
    public native JSString[] split(char sep);

    @NoJavaScript
    public native JSString[] split(char sep,int limit);

    @NoJavaScript
    public native JSString substr(int start);

    @NoJavaScript
    public native JSString substr(int start,int length);

    @NoJavaScript
    public native JSString substring(int from);

    @NoJavaScript
    public native JSString substring(int from,int to);

    @NoJavaScript
    public native JSString toLowerCase();

    @NoJavaScript
    public native JSString toUpperCase();
            
    @NoJavaScript
    public native JSString valueOf();

    @NoJavaScript
    public native JSString anchor(JSString name);

    @NoJavaScript
    public native JSString big();

    @NoJavaScript
    public native JSString bold();

    @NoJavaScript
    public native JSString fixed();

    @NoJavaScript
    public native JSString fontcolor(JSString color);

    @NoJavaScript
    public native JSString fontsize(int size);

    @NoJavaScript
    public native JSString italics();

    @NoJavaScript
    public native JSString link();

    @NoJavaScript
    public native JSString small();

    @NoJavaScript
    public native JSString strike();

    @NoJavaScript
    public native JSString sub();

    @NoJavaScript
    public native JSString sup();
        
    public native int compareTo(JSString other)/*-{
        
    }-*/;
}
